package editro 
{
	import editro.controller.AddNewTaskViewCommand;
	import editro.controller.ExportInfoCommand;
	import editro.controller.LoadDataCommand;
	import editro.controller.StartupAppCommand;
	import editro.events.system.AddNewTaskViewItemEvent;
	import editro.events.system.SystemEvent;
	import editro.model.AntTaskVOListModel;
	import editro.model.ATECacheModel;
	import editro.model.ATEConfigModel;
	import editro.view.AntTaskViewMediator;
	import editro.view.components.AntTaskView;
	import editro.view.components.ArchorLinkLineOverlay;
	import editro.view.components.DockBar;
	import editro.view.components.TaskViewsContainer;
	import editro.view.components.ViewComponentsLayer;
	import editro.view.DockBarMediator;
	import editro.view.LinkLineOverlayMediator;
	import editro.view.TaskViewsContainerMediator;
	import editro.view.ViewComponentsLayerMediator;
	import org.robotlegs.base.ContextEvent;
	import org.robotlegs.mvcs.Context;
	
	/**
	 * ...
	 * @author LEEF LEE_LEAF918@163.COM_QQ969442267
	 */
	public class AntVisualContext extends Context 
	{
		
		public function AntVisualContext(main:Main) 
		{
			super(main);
		}
		
		override public function startup():void 
		{
			injector.mapSingleton(AntTaskVOListModel);
			injector.mapSingleton(ATECacheModel);
			//mediator map
			mediatorMap.mapView(AntTaskView, AntTaskViewMediator);
			mediatorMap.mapView(ArchorLinkLineOverlay, LinkLineOverlayMediator);
			mediatorMap.mapView(TaskViewsContainer, TaskViewsContainerMediator);
			mediatorMap.mapView(ViewComponentsLayer, ViewComponentsLayerMediator);
			mediatorMap.mapView(DockBar, DockBarMediator);
			//起动框架
			commandMap.mapEvent(SystemEvent.LOADED_EXTERNAL_CONFIG, StartupAppCommand, SystemEvent, true);
			//输出信息
			commandMap.mapEvent(SystemEvent.TRACE_RELATIONSHIP_INFO, ExportInfoCommand, SystemEvent);
			//加入一个新一TASK VIEW
			commandMap.mapEvent(AddNewTaskViewItemEvent.ADD_TASK_ITEM_TO_STAGE, AddNewTaskViewCommand, AddNewTaskViewItemEvent, false);
			/**
			 * 暂不用加载外部配置
			 */
			commandMap.mapEvent(ContextEvent.STARTUP_COMPLETE, LoadDataCommand, ContextEvent, true);
			super.startup();
		}
	}

}